home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 003 / propmgr1.arc / ADD2.BLD < prev    next >
Encoding:
Text File  |  1979-12-31  |  8.9 KB  |  325 lines

  1. * DATE 07/31/84  17:22
  2. * ADD2.PRG
  3. * this program will add tenant records to the current files
  4. SET INDEX TO
  5. SET COLON OFF
  6. SET INTENSITY ON
  7. STOR ' ' TO choice
  8. STOR '                                                  ' TO blnks
  9. * set up screen for data entry
  10. *loop until finished adding records
  11. STOR baddr TO mbaddr
  12. STOR bcode TO mbcode
  13. STOR bupdate TO mbupdate
  14. SELE SECONDARY
  15. USE &dr.:tenant
  16. STOR t TO more
  17. STOR t TO first
  18. ERAS
  19. DO WHIL more
  20.  IF first
  21.   STOR 'Add Tenant Records' TO mode
  22.   STOR 'Enter as many tenants as you want. When done, enter a blank for tenant' TO prompt1
  23.   STOR "name and unit or control 'Q' to end session." TO prompt2
  24.   @ 0,26 SAY mode
  25.   @ 1, 0 SAY " -------------------------------------------------"
  26.   @ 1,50 SAY "----------------------------"
  27.   @ 3, 2 SAY "Tenant:"
  28.   @ 3,53 SAY "Code:"
  29.   @ 4, 4 SAY "Unit:"
  30.   @ 4,26 SAY "Building:"
  31.   @ 5, 1 SAY "Contact:"
  32.   @ 5,52 SAY "Phone:"
  33.   @ 6,09 SAY "Alternate mailing address:"
  34.   @ 7,01 SAY "Address:"
  35.   @ 8,01 SAY "City:"
  36.   @ 10, 4 SAY "Type:"
  37.   @ 10,19 SAY "Addl Percentage:"
  38.   @ 10,48 SAY "1st Lease:"
  39.   @ 11,04 SAY "Base:"
  40.   @ 11,47 SAY "Expiration:"
  41.   @ 12, 0 SAY "Security:"
  42.   @ 12,30 SAY "Bank:"
  43.   @ 12,48 SAY "Late Date:"
  44.   @ 13, 4 SAY "Rent:"
  45.   @ 13,25 SAY "Late Chgs:"
  46.   @ 13,48 SAY "Addl Rent:"
  47.   @ 14, 3 SAY "G & E:"
  48.   @ 14,24 SAY "Other Chgs:"
  49.   @ 15, 0 SAY "Rent Due:"
  50.   @ 15,22 SAY "Last Payment:"
  51.   @ 15,49 SAY "Amt Paid:"
  52.   @ 16,00 SAY "Total Yr:"
  53.   @ 16,30 SAY "Flag:"
  54.   @ 16,52 SAY "Total:"
  55.   @ 18, 3 SAY "Notes:"
  56.   @ 18,51 SAY "Update:"
  57.   @ 19, 0 SAY " -------------------------------------------------"
  58.   @ 19,50 SAY "-----------------------------"
  59.  ENDI first
  60.  STOR f TO first
  61.  STOR $(blnks,1,35) TO mtenant
  62.  STOR $(blnks,1,3) TO mtcode
  63.  STOR $(blnks,1,5) to mtunit
  64.  STOR 'R' TO mttype
  65.  STOR $(blnks,1,25) TO mtcontac
  66.  STOR $(blnks,1,13) TO mtphone
  67.  STOR 'N' TO malt
  68.  STOR $(blnks,1,35) TO maltad
  69.  STOR $(blnks,1,35) TO maltcty
  70.  STOR $(blnks,1,8) TO mtexpir
  71.  STOR $(blnks,1,8) TO mtfirst
  72.  STOR 0 TO mtsec
  73.  STOR $(blnks,1,4) TO mtsecb
  74.  STOR $(blnks,1,2) TO mtlate
  75.  STOR 0 TO mtrent
  76.  STOR 0.0000 TO mtrentpc
  77.  STOR 0 TO mtrenpcr
  78.  STOR 0 TO mtlatec
  79.  STOR 0 TO mtaddl
  80.  STOR 0 TO mtrente
  81.  STOR 0 TO mtrentm
  82.  STOR 0 TO mtrentd
  83.  STOR $(blnks,1,8) TO mtrentpd
  84.  STOR 0 TO mtrentp
  85.  STOR 0 TO mtrenty
  86.  STOR 0 TO mtrentt
  87.  STOR $(blnks,1,8) TO mtflag
  88.  STOR $(blnks,1,35) TO mtnotes
  89.  STOR mbupdate TO mtupdate
  90. * setup gets to read data
  91.  @ 3,10 GET mtenant
  92.  @ 3,59 SAY mbcode
  93.  @ 3,61 GET mtcode PICTURE '999'
  94.  @ 4,10 GET mtunit
  95.  @ 4,36 SAY mbaddr
  96.  @ 5,10 GET mtcontac
  97.  @ 5,59 GET mtphone PICTURE '(999)999-9999'
  98.  @ 6,36 GET malt PICTURE '!'
  99.  @ 7,10 GET maltad
  100.  @ 8,10 GET maltcty
  101.  @ 10,10 GET mttype PICTURE '!'
  102.  @ 10,36 GET mtrentpc
  103.  @ 10,59 GET mtfirst PICTURE '99/99/99'
  104.  @ 11,10 GET mtrenpcr
  105.  @ 11,59 GET mtexpir PICTURE '99/99/99'
  106.  @ 12,10 GET mtsec
  107.  @ 12,36 GET mtsecb
  108.  @ 12,59 GET mtlate PICTURE '99'
  109.  @ 13,10 GET mtrent
  110.  @ 13,36 GET mtlatec
  111.  @ 13,59 GET mtaddl
  112.  @ 14,10 GET mtrente
  113.  @ 14,36 GET mtrentm
  114.  @ 15,10 GET mtrentd
  115.  @ 15,36 GET mtrentp PICTURE '99/99/99'
  116.  @ 15,59 GET mtrentp
  117.  @ 16,10 GET mtrenty
  118.  @ 16,36 GET mtflag PICTURE '99/99/99'
  119.  @ 16,59 GET mtrentt
  120.  @ 18,10 GET mtnotes
  121.  @ 18,61 GET mtupdate PICTURE '99/99/99'
  122.  @ 20,00
  123.  @ 21,00
  124.  @ 22,00
  125.  @ 20, 7 SAY prompt1
  126.  @ 21, 7 SAY prompt2
  127.  READ
  128.  CLEA GETS
  129. * test if there is a bad field validation
  130.  IF mtenant <> ' '
  131. * validation
  132.   DO CASE
  133.   CASE mtcode = ' '
  134.    STOR t TO error
  135.   CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  136.    STOR t TO error
  137.   CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  138.    STOR t TO error
  139.   CASE (mttype = 'P'.OR. mttype = 'O') .AND.(.NOT.(mtrentpc >0.AND. mtrenpcr >0))
  140.    STOR t TO error
  141.   OTHE
  142.    STOR f TO error
  143.   ENDC
  144. * if test for error was true then fix the fields that need fixing
  145.   IF error
  146. * erase the lines to be used for prompts
  147.    @ 00,00
  148.    @ 20,00
  149.    @ 21,00
  150.    @ 22,00
  151. * tell them to correct it
  152.    @ 0,18 SAY 'Please Correct the Indicated Data'
  153. * keep looping until all fields are fixed
  154.    STOR t to an:error
  155.    DO WHIL an:error
  156.     DO CASE
  157.     CASE mtcode = ' '
  158.      @ 20,00
  159.      @ 20,15 SAY 'Must have a tenant code                              '
  160.      @ 03,61 GET mtcode PICTURE '999'
  161.      READ
  162.     CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  163.      @ 20,00
  164.      @ 20,15 SAY "Must answer 'Y' or 'N' to alternate address"
  165.      @ 06,36 GET malt PICTURE '!'
  166.      READ
  167.     CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  168.      @ 20,00
  169.      @ 21,00
  170.      @ 20,05 SAY "Type must be 'R' for Regular, 'P' for Percentage which uses the higher of"
  171.      @ 21,05 SAY "the percentage or the base rent or 'O' for Overage plus base rent"
  172.      @ 10,10 GET mttype PICTURE '!'
  173.      READ
  174.     CASE (mttype = 'P'.OR. mttype = 'O').AND.(.NOT.(mtrentpc>0.AND. mtrenpcr> 0))
  175.      @ 20,00
  176.      @ 21,00
  177.      @ 20,05 SAY 'If a percentage or overage lease, you must state the percentage'
  178.      @ 21,05 SAY 'AND the base for calculating the percentage rent'
  179.      @ 10,36 GET mtrentpc
  180.      @ 11,10 GET mtrenpcr
  181.      READ
  182.     OTHE
  183.      STOR f TO an:error
  184.     ENDC
  185.    ENDD while an:error
  186.   ENDI error
  187. * give them another chance
  188.   SET COLON ON
  189.   STOR 'N' TO command
  190.   @ 20,00
  191.   @ 21,00
  192.   @ 22,00
  193.   @ 20,15 SAY 'Are there any more changes ?                        '
  194.   @ 20,48 GET command picture '!'
  195.   READ
  196.   SET COLON OFF
  197.   IF command = 'Y'
  198.    @ 0,00
  199.    @ 0,26 SAY mode
  200.    @ 3,10 GET mtenant
  201.    @ 3,59 SAY mbcode
  202.    @ 3,61 GET mtcode PICTURE '999'
  203.    @ 4,10 GET mtunit
  204.    @ 4,36 SAY mbaddr
  205.    @ 5,10 GET mtcontac
  206.    @ 5,59 GET mtphone PICTURE '(999)999-9999'
  207.    @ 6,36 GET malt PICTURE '!'
  208.    @ 7,10 GET maltad
  209.    @ 8,10 GET maltcty
  210.    @ 10,10 GET mttype PICTURE '!'
  211.    @ 10,36 GET mtrentpc
  212.    @ 10,59 GET mtfirst PICTURE '99/99/99'
  213.    @ 11,10 GET mtrenpcr
  214.    @ 11,59 GET mtexpir PICTURE '99/99/99'
  215.    @ 12,10 GET mtsec
  216.    @ 12,36 GET mtsecb
  217.    @ 12,59 GET mtlate PICTURE '99'
  218.    @ 13,10 GET mtrent
  219.    @ 13,36 GET mtlatec
  220.    @ 13,59 GET mtaddl
  221.    @ 14,10 GET mtrente
  222.    @ 14,36 GET mtrentm
  223.    @ 15,10 GET mtrentd
  224.    @ 15,36 GET mtrentp PICTURE '99/99/99'
  225.    @ 15,59 GET mtrentp
  226.    @ 16,10 GET mtrenty
  227.    @ 16,36 GET mtflag PICTURE '99/99/99'
  228.    @ 16,59 GET mtrentt
  229.    @ 18,10 GET mtnotes
  230.    @ 18,61 GET mtupdate PICTURE '99/99/99'
  231.    @ 20,00
  232.    @ 21,00
  233.    @ 22,00
  234. * let user enter data
  235.    READ
  236.    CLEA GETS
  237.   ENDI command = 'Y'
  238. * put data in file
  239.   APPE BLANK
  240.   STOR mbcode + mtcode TO mbcod1
  241.   REPL tenant WITH mtenant, bcode WITH mbcod1, tunit WITH mtunit
  242.   REPL baddr WITH mbaddr, tcontac WITH mtcontac, tphone WITH mtphone
  243.   REPL alt WITH malt, altad WITH maltad, altcty WITH maltcty
  244.   REPL ttype WITH mttype, texpir WITH mtexpir
  245.   REPL trentpc WITH mtrentpc, trentpcr WITH mtrenpcr
  246.   REPL tfirst WITH mtfirst, tsec WITH mtsec, tsecb WITH mtsecb
  247.   REPL tlate WITH mtlate, trent WITH mtrent, tlatec WITH mtlatec
  248.   REPL taddl WITH mtaddl, trente WITH mtrente, trentm WITH mtrentm
  249.   REPL trentd WITH mtrentd, trentpd WITH mtrentpd, trentp WITH mtrentp
  250.   REPL trenty WITH mtrenty, trentt WITH mtrentt, tflag WITH mtflag
  251.   REPL tnotes WITH mtnotes,tupdate WITH mtupdate
  252.   STOR t TO more
  253.  ELSE
  254. * get ready to stop the loop
  255.   STOR f TO more
  256.  ENDI mtenant <> ' '
  257.  STOR t TO first
  258. ENDD WHILE more
  259. SET COLON ON
  260. STOR 'Y' TO command
  261. ERAS
  262. TEXT
  263.  
  264.       The newly added information is in the database - but will not
  265.       show up on screen until the records are reindexed............
  266.       and reindexing may take a few minutes.
  267.  
  268.       Moreover, if you want to add tenants to another building, you
  269.       should not index until that is done.
  270.  
  271.       In any event, you can reindex at any time.  There is an option
  272.       to reindex on the Maintenance menu.
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284. ENDT
  285. @ 15,10 SAY "Do you wish to REINDEX now (Y/N) ?"
  286. @ 15,44 GET command PICTURE '!'
  287. READ
  288. CLEA GETS
  289. DO WHIL @(command, 'NY') = 0
  290.  @ 15,10 SAY "Do you wish to REINDEX now ?"
  291.  @ 15,44 GET command PICTURE '!'
  292.  READ
  293.  CLEA GETS
  294. ENDD
  295. DO CASE
  296. CASE command = 'Y'
  297. * restore original index and reindex
  298. * since it takes time, tell them
  299.  ERAS
  300.  @ 02,00 SAY 'Files are now being reindexed. '
  301.  @ 03,00 SAY 'Please be patient as this will take a few minutes.'
  302.  @ 04,00 SAY 'I will keep you posted as I go along'
  303.  @ 05,00 SAY ' '
  304. *index transitional part in secondary database
  305.  STOR chr(peek(063)) to dr
  306.  SET ECHO ON
  307.  SET TALK ON
  308.  SELE SECONDARY
  309.  USE &dr.:TENANT INDEX &dr.:codea
  310.  INDE on bcode to &dr.:codea
  311.  SET ECHO OFF
  312.  SET TALK OFF
  313.  STOR f TO more
  314.  STOR t TO first
  315.  STOR ' ' TO choice
  316. CASE command = 'N'
  317.  STOR f TO more
  318. ENDC
  319. STOR chr(peek(063)) to dr
  320. SELE PRIMARY
  321. USE &dr.:build INDEX &dr.:code
  322. SET INTENSITY OFF
  323. STOR ' ' TO choice
  324. STOR t TO first
  325.